# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=lomiri-trust-store
pkgver=2.0.2
pkgrel=0
pkgdesc="API for creating, reading, updating and deleting trust requests answered by users"
url="https://gitlab.com/ubports/development/core/trust-store"
arch="all"
license="LGPL-3.0-only"
depends_dev="
	boost-dev
	dbus-cpp-dev
	libapparmor-dev
	mir-dev
	process-cpp-dev
	properties-cpp-dev
	qt5-qtdeclarative-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	gmock
	gtest-dev
	libapparmor
	samurai
	"
checkdepends="
	coreutils
	dbus
	"
source="https://gitlab.com/ubports/development/core/trust-store/-/archive/$pkgver/trust-store-$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/trust-store-$pkgver"
options="!check" # some tests fail

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DTRUST_STORE_MIR_AGENT_ENABLED=OFF \
		-DENABLE_WERROR=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3dab27f752ad12845a41af04c3a749d89043a2d36cdd81f4705399144b7747f1f37142df8e30e70003ab42d75171e01e99bc6678d39e277f94eb0a8267c856b7  trust-store-2.0.2.tar.gz
"
